#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int T;
    cin >> T;
    while(T--){
        int n;
        cin >> n;

        int k = n / 3;
        if(n % 3 == 0){
            cout << k << " " << k + 1 << " " << k - 1 << '\n';
        }else if(n % 3 == 1){
            cout << k << " " << k + 2 << " " << k - 1 << '\n'; 
        }else{
            cout << k + 1 << " " << k + 2 << " " << k - 1 << '\n';
        }
    }


    return 0;
}